home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / gfx / 3d / irit50src.lha / irit5 / include / iritprsr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-24  |  20.2 KB  |  516 lines

  1. /*****************************************************************************
  2. * Generic parser for the "Irit" solid modeller.                     *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.2, Sep. 1991   *
  5. *****************************************************************************/
  6.  
  7. #ifndef    IRIT_PRSR_H
  8. #define    IRIT_PRSR_H
  9.  
  10. #include <setjmp.h>
  11.  
  12. #include "irit_sm.h"
  13. #include "cagd_lib.h"
  14. #include "trim_lib.h"
  15. #include "triv_lib.h"
  16. #include "genmat.h"
  17.  
  18. /* Dont change the order of these objects (or there values as overloaded     */
  19. /* tables (see overload.c) are hardwired to it. If you add objects update    */
  20. /* that module properly.                             */
  21. typedef enum {
  22.     IP_OBJ_UNDEF = 0,
  23.  
  24.     IP_OBJ_POLY,                     /* These are the objects in overload.c. */
  25.     IP_OBJ_NUMERIC,
  26.     IP_OBJ_POINT,
  27.     IP_OBJ_VECTOR,
  28.     IP_OBJ_PLANE,
  29.     IP_OBJ_MATRIX,
  30.     IP_OBJ_CURVE,
  31.     IP_OBJ_SURFACE,
  32.     IP_OBJ_STRING,
  33.     IP_OBJ_LIST_OBJ,
  34.     IP_OBJ_CTLPT,
  35.     IP_OBJ_TRIMSRF,
  36.     IP_OBJ_TRIVAR,
  37.  
  38.     ANY_OBJ = 100         /* Match any object type, in type checking. */
  39. } IPObjStructType;
  40.  
  41. typedef enum {             /* Possible error code during data parsing. */
  42.     IP_NO_ERR = 0,
  43.  
  44.     IP_ERR_NUMBER_EXPECTED,
  45.     IP_ERR_OPEN_PAREN_EXPECTED,
  46.     IP_ERR_CLOSE_PAREN_EXPECTED,
  47.     IP_ERR_LIST_COMP_UNDEF,
  48.     IP_ERR_UNDEF_EXPR_HEADER,
  49.     IP_ERR_PT_TYPE_EXPECTED,
  50.     IP_ERR_OBJECT_EMPTY,
  51.     IP_ERR_FILE_EMPTY,
  52.     IP_ERR_MIXED_TYPES,
  53.     IP_ERR_STR_NOT_IN_QUOTES,
  54.     IP_ERR_OBJECT_EXPECTED,
  55.     IP_ERR_CAGD_LIB_ERR,
  56.     IP_ERR_TRIM_LIB_ERR,
  57.     IP_ERR_TRIV_LIB_ERR,
  58.     IP_ERR_STACK_OVERFLOW,
  59.     IP_ERR_DEGEN_POLYGON,
  60.     IP_ERR_DEGEN_NORMAL,
  61.     IP_ERR_SOCKET_BROKEN,
  62.     IP_ERR_SOCKET_TIME_OUT,
  63.     IP_ERR_BIN_IN_TEXT,
  64.     IP_ERR_BIN_UNDEF_OBJ,
  65.  
  66.     IP_WRN_OBJ_NAME_TRUNC = 100
  67. } IritPrsrErrType;
  68.  
  69. #define IP_LOAD_COLOR           14  /* Index color default - loaded objects. */
  70.  
  71. #define IRIT_DATA_HEADER(File, Name) \
  72.     fprintf(File, "Irit %s, %s,\nCreator: %s,\nDate: %s.\n\n", \
  73.         VERSION, COPYRIGHT, Name, IritRealTimeDate());
  74.  
  75. /*****************************************************************************
  76. * Global data structures:                             *
  77. * Objects in the system might be (real) scalars, (R3) vectors, matrices      *
  78. * (4 by 4 - transformation matrix), strings of chars, lists of objects, or   *
  79. * geometric objects. All but the last are simple and all their data is saved *
  80. * in the object space itself. The last (geometric) object points on a         *
  81. * curve or a surface or a polygonal list of the form:                 *
  82. *                                         *
  83. * Polygon -> Polygon -> Polygon -> Polygon -> .... -> NULL             *
  84. *    |        |       |          |                         *
  85. *    V          V          V          V                         *
  86. *  VList      VList      VList      VList    (VList = Vertex List)         *
  87. *                                         *
  88. * Each VList is usually a CIRCULAR vertex list. Each VList element           *
  89. * (IPVertexStruct) implicitly defines an edge from this vertex, to the next. *
  90. * As each edge is used by exactly two polygons, a pointer to the other       *
  91. * polygon using this edge exists in the IPVertexStruct as PAdj. Each polygon *
  92. * has also its Plane definition for fast processing, with its normal         *
  93. * pointing INTO the object.                             *
  94. *   Few other tags & flags are included in the data structures for different *
  95. * modules.                                     *
  96. *   Note, vertices are not shared by few VLists/Polygons although it may     *
  97. * decrease memory usage (suprisingly, not much). The main reason to that is  *
  98. * the basic assumption of this solid modeller, which is simplicity...         *
  99. *****************************************************************************/
  100.  
  101. /*****************************************************************************
  102. * Vertex Type - holds single 3D point, including some attributes on it as    *
  103. * Tags. The 3D coordinates are saved in Pt. Pointer to next in chain         *
  104. * is Pnext, and the pointer to the adjacent polygon (to the edge defined by  *
  105. * this Vertex and Vertex -> Pnext) is PAdj.                     *
  106. *****************************************************************************/
  107.  
  108. /* Internal edge, or edge generated by the polygon decomposition stage when  */
  109. /* only convex polygons are allowed. This edge was not in the input         */
  110. /* non-convex polygon, and therefore one may not want to see/display it.     */
  111. /* Note bits 4-7 (high nibble of Tags) are reserved for the different         */
  112. /* modules to perform their local tasks and so should not be used here.         */
  113. #define IP_VRTX_INTERNAL_TAG    0x01    /* Internal Tag - Edge is internal.  */
  114. #define IP_VRTX_NORMAL_TAG    0x02     /* Normal Tag - Vertex has normal.  */
  115.  
  116. #define IP_IS_INTERNAL_VRTX(Vrtx)    (Vrtx -> Tags & IP_VRTX_INTERNAL_TAG)
  117. #define IP_SET_INTERNAL_VRTX(Vrtx)    (Vrtx -> Tags |= IP_VRTX_INTERNAL_TAG)
  118. #define IP_RST_INTERNAL_VRTX(Vrtx)    (Vrtx -> Tags &= ~IP_VRTX_INTERNAL_TAG)
  119. #define IP_HAS_NORMAL_VRTX(Vrtx)    (Vrtx -> Tags & IP_VRTX_NORMAL_TAG)
  120. #define IP_SET_NORMAL_VRTX(Vrtx)    (Vrtx -> Tags |= IP_VRTX_NORMAL_TAG)
  121. #define IP_RST_NORMAL_VRTX(Vrtx)    (Vrtx -> Tags &= ~IP_VRTX_NORMAL_TAG)
  122.  
  123. typedef struct IPVertexStruct {
  124.     struct IPVertexStruct *Pnext;                /* To next in chain. */
  125.     struct IPAttributeStruct *Attrs;
  126.     struct IPPolygonStruct *PAdj;             /* To adjacent polygon. */
  127.     PointType Coord;                   /* Holds X, Y, Z coordinates. */
  128.     NormalType Normal;               /* Hold Vertex normal into the solid. */
  129.     ByteType Count, Tags;                 /* Some attributes. */
  130. } IPVertexStruct;
  131.  
  132. /*****************************************************************************
  133. * Polygon Type - holds single polygon - Its Plane definition, and a pointer  *
  134. * to its vertices contour list V. As for IPVertexStruct, different attributes*
  135. * can be saved in Tags. PAux can be used locally by different modules, for   *
  136. * local usage only, and nothing sould be assumed on entry.             *
  137. *****************************************************************************/
  138.  
  139. /* Note bits 4-7 (high nibble of Tags) are reserved for the different         */
  140. /* modules to perform their local tasks and so should not be used here.         */
  141. #define IP_POLY_CONVEX_TAG    0x01       /* Convex Tag - Set if is convex. */
  142. #define IP_POLY_BBOX_TAG    0x02  /* BBox Tag - Set if BBox is computed. */
  143. #define IP_POLY_PLANE_TAG    0x04    /* Plane Tag - set of has plane def. */
  144.  
  145. #define    IP_IS_CONVEX_POLY(Poly)        ((Poly) -> Tags & IP_POLY_CONVEX_TAG)
  146. #define    IP_SET_CONVEX_POLY(Poly)    ((Poly) -> Tags |= IP_POLY_CONVEX_TAG)
  147. #define    IP_RST_CONVEX_POLY(Poly)    ((Poly) -> Tags &= ~IP_POLY_CONVEX_TAG)
  148. #define    IP_HAS_BBOX_POLY(Poly)        ((Poly) -> Tags & IP_POLY_BBOX_TAG)
  149. #define    IP_SET_BBOX_POLY(Poly)        ((Poly) -> Tags |= IP_POLY_BBOX_TAG)
  150. #define    IP_RST_BBOX_POLY(Poly)        ((Poly) -> Tags &= ~IP_POLY_BBOX_TAG)
  151. #define IP_HAS_PLANE_POLY(Poly)        ((Poly) -> Tags & IP_POLY_PLANE_TAG)
  152. #define IP_SET_PLANE_POLY(Poly)        ((Poly) -> Tags |= IP_POLY_PLANE_TAG)
  153. #define IP_RST_PLANE_POLY(Poly)        ((Poly) -> Tags &= ~IP_POLY_PLANE_TAG)
  154.  
  155. typedef struct IPPolygonStruct {
  156.     struct IPPolygonStruct *Pnext;                /* To next in chain. */
  157.     struct IPAttributeStruct *Attrs;
  158.     VoidPtr PAux;
  159.     int IAux, IAux2;
  160.     PlaneType Plane;             /* Holds Plane as Ax + By + Cz + D. */
  161.     BBoxType BBox;                    /* BBox of polygons. */
  162.     IPVertexStruct *PVertex;                    /* To vertices list. */
  163.     ByteType Count, Tags;                     /* Some attributes. */
  164. } IPPolygonStruct;
  165.  
  166. /*****************************************************************************
  167. * Object Type - main system structure, which holds all the objects defined   *
  168. * in the system like Numeric, Geometric etc.                     *
  169. *   Note that as the number of objects will be usually extermely low (100 is *
  170. * high estimate!) we can waste some memory here...                 *
  171. *****************************************************************************/
  172.  
  173. #define IP_IS_UNDEF_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_UNDEF)
  174. #define IP_IS_POLY_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_POLY)
  175. #define IP_IS_NUM_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_NUMERIC)
  176. #define IP_IS_POINT_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_POINT)
  177. #define IP_IS_VEC_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_VECTOR)
  178. #define IP_IS_PLANE_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_PLANE)
  179. #define IP_IS_CTLPT_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_CTLPT)
  180. #define IP_IS_MAT_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_MATRIX)
  181. #define IP_IS_STR_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_STRING)
  182. #define IP_IS_OLST_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_LIST_OBJ)
  183. #define IP_IS_CRV_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_CURVE)
  184. #define IP_IS_SRF_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_SURFACE)
  185. #define IP_IS_TRIMSRF_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_TRIMSRF)
  186. #define IP_IS_TRIVAR_OBJ(Obj)    ((Obj) -> ObjType == IP_OBJ_TRIVAR)
  187.  
  188. #define IP_IS_GEOM_OBJ(Obj)    (IP_IS_UNDEF_OBJ(Obj) || \
  189.                  IP_IS_POLY_OBJ(Obj) || \
  190.                  IP_IS_POINT_OBJ(Obj) || \
  191.                  IP_IS_CTLPT_OBJ(Obj) || \
  192.                  IP_IS_VEC_OBJ(Obj) || \
  193.                  IP_IS_CRV_OBJ(Obj) || \
  194.                  IP_IS_SRF_OBJ(Obj) || \
  195.                  IP_IS_TRIMSRF_OBJ(Obj) || \
  196.                  IP_IS_TRIVAR_OBJ(Obj))
  197.  
  198. #define IP_IS_FFGEOM_OBJ(Obj)    (IP_IS_CRV_OBJ(Obj) || \
  199.                  IP_IS_SRF_OBJ(Obj) || \
  200.                  IP_IS_TRIMSRF_OBJ(Obj) || \
  201.                  IP_IS_TRIVAR_OBJ(Obj))
  202.  
  203. #define IP_IS_POLYGON_OBJ(Obj)      (((Obj) -> Tags & 0x03) == 0)
  204. #define IP_SET_POLYGON_OBJ(Obj)      ((Obj) -> Tags = ((Obj) -> Tags & 0xfc))
  205. #define IP_IS_POLYLINE_OBJ(Obj)      (((Obj) -> Tags & 0x03) == 1)
  206. #define IP_SET_POLYLINE_OBJ(Obj)  ((Obj) -> Tags = ((Obj) -> Tags & 0xfc) + 1)
  207. #define IP_IS_POINTLIST_OBJ(Obj)  (((Obj) -> Tags & 0x03) == 2)
  208. #define IP_SET_POINTLIST_OBJ(Obj) ((Obj) -> Tags = ((Obj) -> Tags & 0xfc) + 2)
  209.  
  210. /* Maximum size of object list to start with (reallocated dynamically). */
  211. #define MAX_OBJ_LIST    10
  212.  
  213. typedef struct IPObjectStruct {
  214.     struct IPObjectStruct *Pnext;                /* To next in chain. */
  215.     struct IPAttributeStruct *Attrs;
  216.     char Name[OBJ_NAME_LEN];                  /* Name of object. */
  217.     IPObjStructType ObjType;        /* Object Type: Numeric, Geometric, etc. */
  218.     ByteType Count;           /* Count Number of references to this object. */
  219.     unsigned int Tags;                         /* Some attributes. */
  220.     union {
  221.     IPPolygonStruct *Pl;                          /* Polygon/line list. */
  222.     CagdCrvStruct *Crvs;                  /* Free form curve(s). */
  223.     CagdSrfStruct *Srfs;                /* Free form surface(s). */
  224.     TrimSrfStruct *TrimSrfs;        /* Free form trimmed surface(s). */
  225.     TrivTVStruct *Trivars;                 /* Free form trivariate(s). */
  226.     RealType R;                       /* Numeric real data. */
  227.     PointType Pt;                     /* Numeric real point data. */
  228.     VectorType Vec;                    /* Numeric real vector data. */
  229.     PlaneType Plane;                 /* Numeric real plane data. */
  230.     CagdCtlPtStruct CtlPt;                  /* Control point data. */
  231.     MatrixType *Mat;        /* Numeric 4 by 4 transformation matrix. */
  232.     struct {
  233.         struct IPObjectStruct **PObjList;         /* List of objects. */
  234.         int ListMaxLen;          /* Maximum number of elements in list. */
  235.     } Lst;
  236.     char *Str;              /* General string for text object. */
  237.     VoidPtr *VPtr;
  238.     } U;
  239. } IPObjectStruct;
  240.  
  241. typedef void (*IritPrsrPrintFuncType)(char *);
  242.  
  243. #if defined(__cplusplus) || defined(c_plusplus)
  244. extern "C" {
  245. #endif
  246.  
  247. int IritPrsrOpenDataFile(char *FileName, int Read, int Messages);
  248. int IritPrsrOpenStreamFromFile(FILE *f, int Read, int IsBinary, int IsPipe);
  249. int IritPrsrOpenStreamFromSocket(int Soc, int Read, int IsBinary);
  250. void IritPrsrCloseStream(int Handler, int Free);
  251. IPObjectStruct *IritPrsrGetDataFiles(char **DataFileNames,
  252.                      int NumOfDataFiles,
  253.                      int Messages,
  254.                      int MoreMessages);
  255. IPObjectStruct *IritPrsrGetObjects(int Handler);
  256. int IritPrsrSenseBinaryFile(char *FileName);
  257. IPObjectStruct *IritPrsrProcessReadObject(IPObjectStruct *PObj);
  258. IPObjectStruct *IritPrsrFlattenTree(IPObjectStruct *PObj);
  259. void IritPrsrStdoutObject(IPObjectStruct *PObj);
  260. void IritPrsrStderrObject(IPObjectStruct *PObj);
  261. void IritPrsrPutObjectToFile(FILE *f, IPObjectStruct *PObj);
  262. void IritPrsrPutObjectToHandler(int Handler, IPObjectStruct *PObj);
  263. int IritPrsrParseError(int LineNum, char **ErrorMsg);
  264. void IritPrsrPropagateAttrs(IPObjectStruct *PObj, IPAttributeStruct *Attrs);
  265. void IritPrsrInputUnGetC(int Handler, char c);
  266. void IritPrsrSetPolyListCirc(int Circ);
  267. int IritPrsrSetFlattenObjects(int Flatten);
  268. void IritPrsrSetReadOneObject(int OneObject);
  269. void IritPrsrSetPrintFunc(IritPrsrPrintFuncType PrintFunc);
  270. void IritPrsrFatalError(char *Msg);
  271. void IritPrsrSetFloatFormat(char *FloatFormat);
  272. void IritPrsrUpdatePolyPlane(IPPolygonStruct *PPoly);
  273. void IritPrsrUpdatePolyPlane2(IPPolygonStruct *PPoly, VectorType Vin);
  274. void IritPrsrUpdateVrtxNrml(IPPolygonStruct *PPoly, VectorType DefNrml);
  275. IPObjectStruct *IritPrsrReverseObjList(IPObjectStruct *PObj);
  276. void IritPrsrReverseVrtxList(IPPolygonStruct *Pl);
  277.  
  278. /* Binary stream functions. */
  279. IPObjectStruct *IritPrsrGetBinObject(int Handler);
  280. void IritPrsrPutBinObject(int Handler, IPObjectStruct *PObj);
  281.  
  282. /* Will be set to VIEW_MAT and PERS_MAT respectively if found in parsed data.*/
  283. extern MatrixType IritPrsrViewMat, IritPrsrPrspMat;
  284. extern int IritPrsrWasViewMat, IritPrsrWasPrspMat;
  285.  
  286. /* Gets lists of all freeform curves/(trimmed) surfaces/trivariates in the   */
  287. /* datafile, process them as needed.                         */
  288. /*   May return a processed version to be put on returned list from          */
  289. /* IritPrsrGetObjects (polygonal approximation of the free form data for     */
  290. /* example), or NULL otherwise.                             */
  291. /*   This function is responsible to free the freeform data given if not     */
  292. /* needed any more.                                 */
  293. /*   Is function is a call back function that must be provided by the using  */
  294. /* application.    A default function will just concat the data into one list.  */
  295. typedef struct IritPrsrFreeFormStruct {
  296.     IPObjectStruct *CrvObjs;
  297.     IPObjectStruct *SrfObjs;
  298.     IPObjectStruct *TrimSrfObjs;
  299.     IPObjectStruct *TrivarObjs;
  300. } IritPrsrFreeFormStruct;
  301. IPObjectStruct *IritPrsrProcessFreeForm(IritPrsrFreeFormStruct *FreeForms);
  302.  
  303. IPObjectStruct *IritPrsrConcatFreeForm(IritPrsrFreeFormStruct *FreeForms);
  304.  
  305. /* Convexity test for a polygon. */
  306. int IritPrsrIsConvexPolygon(IPPolygonStruct *Pl);
  307.  
  308. /* Last element retrieval routines. */
  309. IPObjectStruct *IritPrsrGetLastObj(IPObjectStruct *OList);
  310. IPObjectStruct *IritPrsrGetPrevObj(IPObjectStruct *OList, IPObjectStruct *O);
  311. IPObjectStruct *IritPrsrAppendObjLists(IPObjectStruct *OList1,
  312.                        IPObjectStruct *OList2);
  313. IPPolygonStruct *IritPrsrGetLastPoly(IPPolygonStruct *PList);
  314. IPPolygonStruct *IritPrsrGetPrevPoly(IPPolygonStruct *PList,
  315.                      IPPolygonStruct *P);
  316. IPPolygonStruct *IritPrsrAppendPolyLists(IPPolygonStruct *PList1,
  317.                      IPPolygonStruct *PList2);
  318. IPVertexStruct *IritPrsrGetLastVrtx(IPVertexStruct *VList);
  319. IPVertexStruct *IritPrsrGetPrevVrtx(IPVertexStruct *VList, IPVertexStruct *V);
  320. IPVertexStruct *IritPrsrAppendVrtxLists(IPVertexStruct *VList1,
  321.                     IPVertexStruct *VList2);
  322. int IritPrsrObjListLen(IPObjectStruct *O);
  323. int IritPrsrPolyListLen(IPPolygonStruct *P);
  324. int IritPrsrVrtxListLen(IPVertexStruct *V);
  325.  
  326. /* Coercion of objects. */
  327. CagdPointType IritPrsrCoerceCommonSpace(IPObjectStruct *PtObjList, int Type);
  328. CagdPointType IritPrsrCoercePtsListTo(IPObjectStruct *PtObjList, int Type);
  329. IPObjectStruct *IritPrsrCoerceObjectTo(IPObjectStruct *PObj, int NewType);
  330.  
  331. /* Special objects' read and write functions. These functions are used to   */
  332. /* read and write objects of other libraries to and from data files.        */
  333.  
  334. CagdCrvStruct *CagdCrvReadFromFile(char *FileName, char **ErrStr, int *ErrLine);
  335. CagdCrvStruct *CagdCrvReadFromFile2(int Handler, char **ErrStr, int *ErrLine);
  336. int CagdCrvWriteToFile(CagdCrvStruct *Crvs,
  337.                char *FileName,
  338.                int Indent,
  339.                char *Comment,
  340.                char **ErrStr);
  341. int CagdCrvWriteToFile2(CagdCrvStruct *Crvs,
  342.             int Handler,
  343.             int Indent,
  344.             char *Comment,
  345.             char **ErrStr);
  346. int CagdCrvWriteToFile3(CagdCrvStruct *Crvs,
  347.             FILE *f,
  348.             int Indent,
  349.             char *Comment,
  350.             char **ErrStr);
  351.  
  352. CagdSrfStruct *CagdSrfReadFromFile(char *FileName,
  353.                    char **ErrStr,
  354.                    int *ErrLine);
  355. CagdSrfStruct *CagdSrfReadFromFile2(int Handler, char **ErrStr, int *ErrLine);
  356. int CagdSrfWriteToFile(CagdSrfStruct *Srfs,
  357.                char *FileName,
  358.                int Indent,
  359.                char *Comment,
  360.                char **ErrStr);
  361. int CagdSrfWriteToFile2(CagdSrfStruct *Srfs,
  362.             int Handler,
  363.             int Indent,
  364.             char *Comment,
  365.             char **ErrStr);
  366. int CagdSrfWriteToFile3(CagdSrfStruct *Srfs,
  367.             FILE *f,
  368.             int Indent,
  369.             char *Comment,
  370.             char **ErrStr);
  371. CagdCrvStruct *BzrCrvReadFromFile(char *FileName, char **ErrStr, int *ErrLine);
  372. CagdCrvStruct *BzrCrvReadFromFile2(int Handler,
  373.                    CagdBType NameWasRead,
  374.                    char **ErrStr,
  375.                    int *ErrLine);
  376. int BzrCrvWriteToFile(CagdCrvStruct *Crvs,
  377.               char *FileName,
  378.               int Indent,
  379.               char *Comment,
  380.               char **ErrStr);
  381. int BzrCrvWriteToFile2(CagdCrvStruct *Crvs,
  382.                int Handler,
  383.                int Indent,
  384.                char *Comment,
  385.                char **ErrStr);
  386. CagdSrfStruct *BzrSrfReadFromFile(char *FileName, char **ErrStr, int *ErrLine);
  387. CagdSrfStruct *BzrSrfReadFromFile2(int Handler,
  388.                    CagdBType NameWasRead,
  389.                    char **ErrStr,
  390.                    int *ErrLine);
  391. int BzrSrfWriteToFile(CagdSrfStruct *Srfs,
  392.               char *FileName,
  393.               int Indent,
  394.               char *Comment,
  395.               char **ErrStr);
  396. int BzrSrfWriteToFile2(CagdSrfStruct *Srfs,
  397.                int Handler,
  398.                int Indent,
  399.                char *Comment,
  400.                char **ErrStr);
  401. CagdCrvStruct *BspCrvReadFromFile(char *FileName, char **ErrStr, int *ErrLine);
  402. CagdCrvStruct *BspCrvReadFromFile2(int Handler,
  403.                    CagdBType NameWasRead,
  404.                    char **ErrStr,
  405.                    int *ErrLine);
  406. int BspCrvWriteToFile(CagdCrvStruct *Crvs,
  407.               char *FileName,
  408.               int Indent,
  409.               char *Comment,
  410.               char **ErrStr);
  411. int BspCrvWriteToFile2(CagdCrvStruct *Crvs,
  412.                int Handler,
  413.                int Indent,
  414.                char *Comment,
  415.                char **ErrStr);
  416. CagdSrfStruct *BspSrfReadFromFile(char *FileName, char **ErrStr, int *ErrLine);
  417. CagdSrfStruct *BspSrfReadFromFile2(int Handler,
  418.                    CagdBType NameWasRead,
  419.                    char **ErrStr,
  420.                    int *ErrLine);
  421. int BspSrfWriteToFile(CagdSrfStruct *Srfs,
  422.               char *FileName,
  423.               int Indent,
  424.               char *Comment,
  425.               char **ErrStr);
  426. int BspSrfWriteToFile2(CagdSrfStruct *Srfs,
  427.                int Handler,
  428.                int Indent,
  429.                char *Comment,
  430.                char **ErrStr);
  431.  
  432. TrivTVStruct *TrivTVReadFromFile(char *FileName, char **ErrStr, int *ErrLine);
  433. TrivTVStruct *TrivTVReadFromFile2(int Handler, char **ErrStr, int *ErrLine);
  434. TrivTVStruct *TrivBzrTVReadFromFile(char *FileName,
  435.                     char **ErrStr,
  436.                     int *ErrLine);
  437. TrivTVStruct *TrivBzrTVReadFromFile2(int Handler, CagdBType NameWasRead,
  438.                      char **ErrStr,
  439.                      int *ErrLine);
  440. TrivTVStruct *TrivBspTVReadFromFile(char *FileName,
  441.                     char **ErrStr,
  442.                     int *ErrLine);
  443. TrivTVStruct *TrivBspTVReadFromFile2(int Handler,
  444.                      CagdBType NameWasRead,
  445.                      char **ErrStr,
  446.                      int *ErrLine);
  447. int TrivTVWriteToFile(TrivTVStruct *TVs,
  448.               char *FileName, 
  449.               int Indent,
  450.               char *Comment,
  451.               char **ErrStr);
  452. int TrivTVWriteToFile2(TrivTVStruct *TVs,
  453.                int Handler,
  454.                int Indent,
  455.                char *Comment,
  456.                char **ErrStr);
  457. int TrivTVWriteToFile3(TrivTVStruct *TVs,
  458.                FILE *f,
  459.                int Indent,
  460.                char *Comment,
  461.                char **ErrStr);
  462. int TrivBzrTVWriteToFile(TrivTVStruct *TVs,
  463.              char *FileName,
  464.              int Indent,
  465.              char *Comment,
  466.              char **ErrStr);
  467. int TrivBzrTVWriteToFile2(TrivTVStruct *TVs,
  468.               int Handler,
  469.               int Indent,
  470.               char *Comment,
  471.               char **ErrStr);
  472. int TrivBspTVWriteToFile(TrivTVStruct *TVs,
  473.              char *FileName,
  474.              int Indent,
  475.              char *Comment,
  476.              char **ErrStr);
  477. int TrivBspTVWriteToFile2(TrivTVStruct *TVs,
  478.               int Handler,
  479.               int Indent,
  480.               char *Comment,
  481.               char **ErrStr);
  482.  
  483. TrimSrfStruct *TrimReadTrimmedSrfFromFile(char *FileName,
  484.                       char **ErrStr,
  485.                       int *ErrLine);
  486. TrimSrfStruct *TrimReadTrimmedSrfFromFile2(int Handler,
  487.                        CagdBType NameWasRead,
  488.                        char **ErrStr,
  489.                        int *ErrLine);
  490. int TrimWriteTrimmedSrfToFile(TrimSrfStruct *TrimSrfs,
  491.                   char *FileName,
  492.                   int Indent,
  493.                   char *Comment,
  494.                   char **ErrStr);
  495. int TrimWriteTrimmedSrfToFile2(TrimSrfStruct *TrimSrfs,
  496.                    int Handler,
  497.                    int Indent,
  498.                    char *Comment,
  499.                    char **ErrStr);
  500. int TrimWriteTrimmedSrfToFile3(TrimSrfStruct *TrimSrfs,
  501.                    FILE *f,
  502.                    int Indent,
  503.                    char *Comment,
  504.                    char **ErrStr);
  505.  
  506.  
  507. #ifdef DEBUG
  508. void IritPrsrDbg(void);
  509. #endif /* DEBUG */
  510.  
  511. #if defined(__cplusplus) || defined(c_plusplus)
  512. }
  513. #endif
  514.  
  515. #endif    /* IRIT_PRSR_H */
  516.